package com.timoon.webcomponent.utility.navs.bootstrap;

import java.util.List;

import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.link.BookmarkablePageLink;
import org.apache.wicket.markup.html.list.ListItem;
import org.apache.wicket.markup.html.list.ListView;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.IModel;

import com.timoon.webcomponent.utility.navs.BaseNavPanel;
import com.timoon.webcomponent.utility.navs.NavParameter;

/**
 *<p></p>
 *<p></p>
 *<p>Copyright:Copyright(c)2013.4.1</p>
 *<p>Company:timoon</p>
 *@author 付乐天
 *@version 1.0 */
public class BootstrapNavPanel extends BaseNavPanel {

	
	public BootstrapNavPanel(String id,List<NavParameter> navs) {
		super(id,navs);
		// TODO Auto-generated constructor stub
		
		//循环<li>
		ListView<NavParameter> listView=new ListView<NavParameter>("wk_li",navs) {
			
			@Override
			protected void populateItem(ListItem<NavParameter> arg0) {
				// TODO Auto-generated method stub
				NavParameter param=arg0.getModelObject();
				
				BookmarkablePageLink link=new BookmarkablePageLink<>("wk_a", param.getTargetPage());
				arg0.add(link);
				
				link.add(new Label("wk_span",param.getText()));
			}
		};
		add(listView);
	}


}
